package com.qire.other.share;

import com.qire.manhua.wxapi.WXEntryActivity;

import java.util.HashMap;

import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.Platform.ShareParams;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.wechat.friends.Wechat;

/**
 * 微信好友分享
 */
public class WeChatShareAction extends ShareActionImpl {

	@Override
	protected ShareParams createShareParams(ShareParams shareParams, HashMap<String, Object> shareMap) {
		fillShareParams(shareParams, shareMap, "shareType");
		fillShareParams(shareParams, shareMap, "title");
		fillShareParams(shareParams, shareMap, "text");
		fillShareParams(shareParams, shareMap, "url");
		fillShareParams(shareParams, shareMap, "imageData");
		fillShareParams(shareParams, shareMap, "imageUrl");
		return shareParams;
	}

	@Override
	protected Platform createPlatform() {
		WXEntryActivity.setShareCallback(this::onComplete);
		return ShareSDK.getPlatform(Wechat.NAME);
	}
}
